<template>
	<view>

		<scroll-view scroll-x="true" class="scroll-box">
			<view :class="'item-box'+' bg'+((index+'').slice(-1))" v-for="(item,index) in goodsList" :key="index"
				@click="chooseItem(item)">
				<image style="width: 100rpx;height: 100rpx;border-radius: 50%;" :src="item.image" mode="">
				</image>
				<!-- <image :src="item.icon" mode=""></image> -->
				<view class="item-name">{{item.name}}</view>

			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		props: {
			listTitle: {
				type: String,
				default: ''
			},
			goodsList: {
				type: Array,
				default: () => []
			},
			imgWidth: {
				type: Number,
				default: 128
			},
			imgHeight: {
				type: Number,
				default: 128
			}
		},
		data() {
			return {}
		},
		methods: {
			//点击某个item
			chooseItem(item) {

				uni.navigateTo({
					url: "/pagesA/hospital/doctorInfo?id=" + item.id
				})
				this.$emit("clickItem", item)
			}
		}
	}
</script>

<style>
	/deep/ ::-webkit-scrollbar {
		width: 0;
		height: 0;
		color: transparent;
		display: none;
	}
</style>
<style scoped>
	.subtitle {
		padding: 16rpx 32rpx;
		font-size: 32rpx;
		font-weight: bold;
		color: #333333;
		line-height: 48rpx;
	}

	.scroll-box {
		display: flex;
		white-space: nowrap;
		width: 100%;
		min-height: 242rpx;
	}

	.item-box {

		display: inline-block;
		/* width: 100rpx; */
		height: 100%;
		padding: 16rpx;
		margin-right: 8rpx;
		width: 120rpx;
		text-align: center;
	}

	.item-name {
		display: table;
		/* width: 100%; */
		/* font-size: 28rpx; */
		/* line-height: 32rpx; */
		font-weight: bold;
		/* white-space: pre-wrap; */
		/* color: #333333; */
		/* margin-top: 8rpx; */
		/* display: -webkit-box; */
		/* -webkit-box-orient: vertical; */
		/* -webkit-line-clamp: 1; */
		/* overflow: hidden; */
		text-align: center;
		width: 100%;
		/* 	display: table;
		width: 100%;
		font-size: 28rpx;
		line-height: 32rpx;
		font-weight: bold;
		white-space: pre-wrap;
		color: #333333;
		margin-top: 8rpx;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 1;
		overflow: hidden; */
	}

	.item-descr {
		display: table;
		width: 100%;
		font-size: 24rpx;
		line-height: 24rpx;
		white-space: pre-wrap;
		color: #999999;
		margin-top: 12rpx;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 1;
		overflow: hidden;
	}
</style>